    <script src="assets/js/mustache.js"></script>
    
    <div class="container admin_slide">
        <form>
            <table class="table">
                <thead>
                    <tr>
                        <th>#</th>
                        <th>帖子ID</th>
                        <th>标题</th>
                        <th>描述</th>
                        <th>封面</th>
                    </tr>
                </thead>
                <tbody>
                <?php
                    if (!isset($slides)) {
                        echo '<tr><td colspan="4">暂无</td></tr>';
                    } else {
                        foreach($slides as $slide) {
                            echo '
                                <tr>
                                    <td><span class="slide_id">' . $slide['slide_id'] . '</span></td>
                                    <td><input type="text" class="slide_post_id" value="' . $slide['post_id'] . '"></td>
                                    <td><input type="text" class="slide_title" value="' . $slide['slide_title'] . '"></td>
                                    <td><input type="text" class="slide_content" value="' . $slide['slide_content'] . '"></td>
                                    <td><a class="btn slide_cover" value="' . $slide['slide_cover_id'] . '">' . (($slide['slide_cover_id'] != 0) ? ('已选择：' . $slide['slide_cover_id']) : '选择封面') . '</a></td>
                                </tr>
                            ';
                        }
                    }
                ?>
                </tbody>
            </table>
        </form>
        <div class="control-group slide_update_div">
            <div class="btn-group">
                <button class="btn btn-primary" id="slide_update">更新</button>
                <button class="btn" id="slide_discard">放弃</button>
            </div>
        </div>
    </div>
    <div class="modal hide fade" id="slide_cover_modal">
        <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal">x</button>
            <h2>选择封面</h2>
        </div>    
        <div class="modal-body">
            <div id="slide_cover_carousel" class="carousel slide">
                <ol class="carousel-indicators">
                </ol>
                <div class="carousel-inner">
                </div>
                <a class="carousel-control left" href="#slide_cover_carousel" data-slide="prev">&lsaquo;</a>
                <a class="carousel-control right" href="#slide_cover_carousel" data-slide="next">&rsaquo;</a>
            </div>            
        </div>
        <div class="modal-footer">
            <div class="btn-group">
                <a class="btn btn-primary" id="slide_cover_btn">确定</a>
                <a class="btn" id="slide_cover_cancel">取消</a>
            </div>
        </div>
        </form>
    </div>